using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CC.BLLs;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using MX.Core.Log;
using MX.Core.ORM;


namespace CC.Api
{
    public class Program
    {
        public static void Main(string[] args)
        {
            DatabaseConfig.RegisterStringKey(Database.CC, "CC");
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseStartup<Startup>();
                }).ConfigureLogging(logging => {
                    
                    logging.ClearProviders(); 
                    logging.AddProvider(new MXLoggerProvider());
                }) ;
    }
}
